<extend name="Layout/ins_page" />
<block name="content">
	{:W('PageHeader/simple',array('name'=>'邮件帐户设置'))}
	<div class="sub-frame gray">
		<form method='post' id="form_data" >
			<input type="hidden" id="ajax" name="ajax" value="1">
			<input type="hidden" id="opmode" name="opmode" value="{$opmode}">
			<div class="layui-form-item">
				<label class="layui-form-label" for="mail_name">邮件显示名称*：</label>
				<div class="layui-input-block">
					<input class="layui-input" type="mail_name" id="mail_name" name="mail_name" check="required" info="请输入显示名称" value="{$mail_user.mail_name}" >
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" for="email">邮件地址*：</label>
				<div class="layui-input-block">
					<input class="layui-input" type="email" id="email" name="email" check="required" info="请输入显示名称" value="{$mail_user.email}" >
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" for="pop3svr">接收服务器*：</label>
				<div class="layui-input-block">
					<input class="layui-input" type="pop3svr" id="pop3svr" name="pop3svr" check="required" info="请输入接收服务器" value="{$mail_user.pop3svr}" >
					<span class="help-inline">例如：pop.qq.com</span>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" for="smtpsvr">发送服务器*：</label>
				<div class="layui-input-block">
					<input class="layui-input" type="smtpsvr" id="smtpsvr" name="smtpsvr" check="required" info="请输入接收服务器" value="{$mail_user.smtpsvr}" >
					<span class="help-inline">例如：smtp.qq.com</span>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" for="mail_id">用户名*：</label>
				<div class="layui-input-block">
					<input class="layui-input" type="smtpsvr" id="mail_id" name="mail_id" check="required" info="请输入用户名" value="{$mail_user.mail_id}" >
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" for="mail_pwd">密码*：</label>
				<div class="layui-input-block">
					<input class="layui-input" type="password" id="mail_pwd" name="mail_pwd" check="required" info="请输入用户名" value="{$mail_user.mail_pwd}" >
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input class="btn" type="button" value="保存" id="btn_save">
				</div>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global'], function() {
			var $ = layui.jquery;
			$("#btn_save").on('click', function() {
				send_form("form_data", "{:U('save')}", "{:U('index')}", function(ret) {
					if (ret.status) {
						layer.msg(ret.info);
						location.reload(true);
					} else {
						layer.msg(ret.info);
						return false;
					}
				});
			});
		});
	</script>
</block>